﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Client.Forms
{
    public partial class CreateCardsForm : Form
    {
        public CreateCardsForm()
        {
            InitializeComponent();
        }

        private void Button1_Click(object sender, EventArgs e)
        {
            if (amountTextBox.Text == "" || (numTextBox.Text == "" && useridTextBox.Text == ""))
            {
                MessageBox.Show("有必填项未填写");
                return;
            }
            string str = "";
            if (useridTextBox.Text != "")
                str = DataCenter.DataCenter.TopupDirect(int.Parse(amountTextBox.Text), useridTextBox.Text, friendidTextBox.Text);
            else if (numTextBox.Text != "")
                str = DataCenter.DataCenter.CreateCards(int.Parse(amountTextBox.Text), int.Parse(numTextBox.Text));
            MessageBox.Show(str);
        }

        private void Button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
